LinuxQMISDK-Lite  SLQS04.00.27
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Functions
QmiService.h File Reference

Go to the source code of this file.

Data Structures

struct  QmiService
 

Macros

#define QMI_TRANSACTION_POOL_SIZE   10
 

Typedefs

typedef void(* QMI_INDICATION_CALLBACK )(uint8_t *qmiPacket, uint16_t qmiPacketSize, void *pIndicationCallbackContext)
 
typedef struct QmiService QmiService
 

Functions

void QmiService_Initialize (QmiService *pThis, uint8_t serviceType, uint8_t clientId, struct QmuxTransport *pTransport, QMI_INDICATION_CALLBACK pIndicationCallback, void *pIndicationCallbackContext)
 
void QmiService_ShutDown (QmiService *pThis)
 
uint16_t QmiService_GetNextTransactionId (QmiService *pThis)
 
int QmiService_SendRequest (QmiService *pThis, uint16_t transactionId, uint8_t *qmiRequest, uint16_t qmiRequestSize, QMI_RESPONSE_CALLBACK pResponseCallback, void *pResponseCallbackContext)
 
void QmiService_CancelTransaction (QmiService *pThis, uint16_t transactionId)
 
bool QmiService_HandleQmiPacket (QmiService *pThis, uint8_t serviceType, uint8_t clientId, uint8_t *qmiPacket, uint16_t qmiPacketSize)
 

Macro Definition Documentation

#define QMI_TRANSACTION_POOL_SIZE   10

Number of concurrent QMI transactions that may be outstanding per QMI service.

Typedef Documentation

typedef void(* QMI_INDICATION_CALLBACK)(uint8_t *qmiPacket, uint16_t qmiPacketSize, void *pIndicationCallbackContext)

This funcion prototype represents the callback which is called by the QMI service when a QMI indication is received.

Parameters
[in]qmiPacketindication's QMI packet (note: this does not include QMUX header).
[in]qmiPacketSizeNumber of bytes in indication's QMI packet.
[in]pIndicationCallbackContextUser context supplied when QMI service was initialized.
typedef struct QmiService QmiService

This structure abstracts a QMI service. It is responsible issuing transaction IDs. It tracks QMI requests and responses using transaction objects from a pool. It invokes a user callback when QMI indications which match its client ID (or a broadcast ID) are received from the transport layer.

Parameters
pNext
  • A link so we can store this object in a linked list by the transport layer.
serviceType
  • QMI service type, CTL, NAS, etc.
clientId
  • QMI client ID
pTransport
  • Pointer to underlying QMUX transport object.
transactionId
  • QMI transaction ID. Upper limit 0xffff for regular QMI services, 0xff for CTL service.
transactionIdLock
  • Mutex to make transactionId access thread-safe.
transactionPool
  • Pool of transaction objects which may be assigned to QMI requests made by clients of this service.
transactionPoolLock
  • Mutex to make transactionPool access thread-safe
pIndicationCallback
  • User callback for QMI indications of this service.
pIndicationCallbackContext
  • User context for user callback.
deviceFd
  • Store service fd.
pQcqmitransport
  • Pointer to QMI service transport object.

Function Documentation

void QmiService_CancelTransaction ( QmiService pThis,
uint16_t  transactionId 
)

Cancel an outstanding QMI request.

Parameters
[in]pThisThe primary object of this call.
[in]transactionIdTransaction ID of outstanding request.
uint16_t QmiService_GetNextTransactionId ( QmiService pThis)

Returns next transaction ID for a QMI service.

Parameters
[in]pThisThe primary object of this call.
Returns
transaction ID
bool QmiService_HandleQmiPacket ( QmiService pThis,
uint8_t  serviceType,
uint8_t  clientId,
uint8_t *  qmiPacket,
uint16_t  qmiPacketSize 
)

Process a received QMI packet. This function is called by the QMUX transport layer.

Parameters
[in]pThisThe primary object of this call.
[in]serviceTypeQMI service type of received packet.
[in]clientIdQMI Client ID of received packet.
[in]qmiPacketPointer to QMI packet.
[in]qmiPacketSizePointer to size in bytes of QMI packet.
Returns
true if packet is consumed by function, false if it should be offered to another QMI service
void QmiService_Initialize ( QmiService pThis,
uint8_t  serviceType,
uint8_t  clientId,
struct QmuxTransport pTransport,
QMI_INDICATION_CALLBACK  pIndicationCallback,
void *  pIndicationCallbackContext 
)

Initialize QMI service.

Parameters
[in]pThisThe primary object of this call.
[in]serviceTypeQMI service e.g. NAS, etc.
[in]clientIdValue previously obtained by invoking CtlService_GetClientId
[in]pTransportPointer to underlying transport layer which is responsible for sending and receiving QMUX packets
[in]pIndicationCallbackUser function to be be called when QMI indications are received.
[in]pIndicationCallbackContextA user context for callback.
int QmiService_SendRequest ( QmiService pThis,
uint16_t  transactionId,
uint8_t *  qmiRequest,
uint16_t  qmiRequestSize,
QMI_RESPONSE_CALLBACK  pResponseCallback,
void *  pResponseCallbackContext 
)

Send a QMI request to the device and return immediately.

Parameters
[in]pThisThe primary object of this call.
[in]transactionIdtransaction ID obtained by previous call to QmiService_GetNextTransactionId.
[in]qmiRequestQMI request (this becomes the QMUX SDU).
[in]qmiRequestSizeSize in bytes of QMI request.
[in]pResponseCallbackCallback called when QMI request completes.
[in]pResponseCallbackContextContext for callback.
Returns
0 on success, < 0 on failure.
void QmiService_ShutDown ( QmiService pThis)

Shut down QMI service. Brings service to an uninitiaized state.

Parameters
[in]pThisThe primary object of this call.

Copyright (c) 2011-2015 Sierra Wireless, Inc. All rights reserved